package com.example.init.controller;

import com.example.init.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class BeanController {

    @Bean
    public String name(){
        return "wen";
    }

    @Bean
    public String name2(){
        return "liu";
    }

    @Primary
    @Bean
    public Person person(String name){
        Person person = new Person(1,name);
        return person;
    }

    @Bean
    public Person person2(){
        Person person = new Person(2,"li");
        return person;
    }

}
